package com.huazhi.wzsnw.util;


import com.huazhi.wzsnw.model.po.RedisSuper;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Properties;

public class PropertyUtil {
	private static  Properties properties_default = new Properties();
	
		static{
		try {
			properties_default.load(new InputStreamReader(com.huazhi.wzsnw.util.PropertyUtil.class.getResourceAsStream("/db.properties"), "UTF-8"));

		} catch (FileNotFoundException e1) {
			e1.printStackTrace();
		} catch (IOException e) {

			e.printStackTrace();
		}
	
		}
	
	
	public static String getText(String key){
		Properties properties = null;
		
		properties = properties_default;
		

		String content  = properties.getProperty(key);

		return content;
	}

	public static int updateRedis(String key,String field, String value , RedisSuper redis){
		try {
			redis.hPut(key,field,value);
		}catch (Exception e){
			e.printStackTrace();
			return  -1;
		}
		return 1;

	}
	
	
}
